package com.zui.entity.product;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.zui.entity.BaseAutoIdEntity;



@Entity
//product, feature, fromDate唯一性；
@Table(name="feature_cat_cat_appl",
uniqueConstraints={@UniqueConstraint(name="uc_feature_cat_cat_appl",
		columnNames={"categoryId", "FeatureCategoryId", "fromDate"})})
/**
 * link table for category and feature category
 * @author Sam
 */
public class FeatureCategoryAppl extends BaseAutoIdEntity {
	private static final long serialVersionUID = 1L;
	
	public FeatureCategoryAppl() {}
	
	private Category category;
	private FeatureCategory featureCategory;
	private Date fromDate;
	private Date thruDate;
	private Integer sequenceNum;

	@ManyToOne() @JoinColumn(name="categoryId")
	public Category getCategory() {
		return category;
	}
	@ManyToOne() @JoinColumn(name="FeatureCategoryId")
	public FeatureCategory getFeatureCategory() {
		return featureCategory;
	}
	public Date getFromDate() {
		return fromDate;
	}
	public Date getThruDate() {
		return thruDate;
	}
	public Integer getSequenceNum() {
		return sequenceNum;
	}

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	public void setCategory(Category category) {
		this.category = category;
	}
	public void setFeatureCategory(FeatureCategory featureCategory) {
		this.featureCategory = featureCategory;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public void setThruDate(Date thruDate) {
		this.thruDate = thruDate;
	}
	public void setSequenceNum(Integer sequenceNum) {
		this.sequenceNum = sequenceNum;
	}
}
